<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<!DOCTYPE html>

<html>
<head>
	<meta charset="utf-8" />
	<title></title>
	<link rel="Stylesheet" href="/carple/styles/default.css" />
	<link rel="Stylesheet" href="/carple/styles/input.css" />
	<link rel="stylesheet" href="/carple/styles/main.css" />
	<link rel="stylesheet" href="/carple/styles/slides.css" />
	<script type="text/javascript">
	function checkAndSubmit() {
		var message ="";
		var memberID = document.getElementById("emailId");
		if (memberID.value.length == 0) {
			message += "아이디를입력하세요.\r\n";
		}
		//var re = new RegExp("^[0-9A-Za-z]{5,20}$");
		//var re = /^[0-9A-Za-z]{5,20}$/;
		//if (!re.test(memberID.value)) {
		//	message += "아이디 형식 오류 (영문자, 숫자 조합 5~20개) \r\n";
		//}
		
		var passwd = document.getElementById("passwd");
		if (passwd.value.length == 0) {
			message += "비밀번호를 입력하시요.\r\n";
		}
		
		var confirm = document.getElementById("confirm");
		if(confirm.value != passwd.value) {
			message += "비밀번호 불일치\r\n";
		}
		
		if (message.length >0) {
			alert(message);
		}else {
			document.getElementById("registerform").submit();
		}
	}
	</script>
</head>
<body>
	<% pageContext.include("/WEB-INF/views/include/header.jsp"); %>
	<br /><br /><br /><br /><br /><br />
	<div id="pageContainer">	
		<div id="inputcontent">
			<br /><br />
		    <div id="inputmain">
		        <div class="inputsubtitle">회원기본정보</div>

		        <form id="registerform" action="register.action" method="post" enctype="multipart/form-data"><!-- 상대경로표시 -->
		 
		        <table>
		            <tr>
		                <th>email(ID)</th>
		                <td>
		                    <input type="text" id="emailId" name="emailId" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>비밀번호</th>
		                <td>
		                	<input type="password" id="passwd" name="passwd" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>비밀번호 확인</th>
		                <td>
		                    <input type="password" id="confirm" name="confirm" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>성</th>
		                <td>
		                	남자 <input type="radio" name="gender" value="male" checked="checked" style="width:20px" />
		                	여자 <input type="radio" name="gender" value="female" style="width:20px" />
		                </td>
		            </tr>
		             <tr>
		                <th>차량소유</th>
		                <td>
		                	소유<input type="radio" name="isOwner"  value="owner" checked="checked" style="width:20px" />
		                	무소유<input type="radio" name="isOwner" value="non-owner" style="width:20px" />
		                </td>
		            </tr>
		             <tr>
		                <th>차량모델</th>
		                <td>
		                	<input type="text" name="carModel" style="width:280px" />
		                </td>
		            </tr>
		             <tr>
		                <th>닉네임</th>
		                <td>
		                	<input type="text" name="nickName" style="width:280px" />
		                </td>
		            </tr>
		             <tr>
		                <th>본명</th>
		                <td>
		                	<input type="text" name="realName" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>프로필 사진 </th>
		                <td>
		                	<input type="file" name="attach" style="width:200px;height:20px" /> 
		                </td>
		            </tr>
		            
 		         <!--    <tr>
		                <th>사용자구분</th>
		                <td>
		                	<input type="radio" name="userType" value="user" checked="checked">사용자</input>
		                	<input type="radio" name="userType" value="admin">관리자</input>
		                </td>
		            </tr>
		            <tr>
		                <th>활성화여부</th>
		                <td>
		                	<input type="checkbox" name="active" value="y">활성사용자</input>
		                </td>
		            </tr>	 --> 	            		            
		        </table>
		        <div class="buttons">
		        	<input id="regist" type="button" value="등록" style="height:25px" onclick="checkAndSubmit();" />
		        	
		        	<input type="button" value="취소" style="height:25px"
		        		onclick="location.href='/carple/index.jsp';" />

		        </div>
		        </form>
		    </div>
		</div>   	
	
	</div>

</body>
</html>